#pragma once
#include "afx.h"
#include <vector>
#include ".\boundedfunctiondescription.h"


#define FUNCNUM 3
#define DRAW_GRID 0

class CEvaluatingFunction :
	public CObject
{
	
public:
	BoundedFunctionDescription::pointer Function; 

public:
	typedef pair<double, double> ValDiffCoeff;
	static pair<BoundedFunctionDescription::Evaluate, string> getChoices(size_t num);

protected:
	F<double> RangeMin;
	F<double> RangeMax;
	size_t FitnessCasesNumber;

public:
	double getLowerBound( ) {return	RangeMin.x( );};
	double getUpperBound( ) {return	RangeMax.x( );};
	size_t  getFitnessCasesNumber( ) const {return FitnessCasesNumber;};


protected:
	size_t funChoice;
	BoundedFunctionDescription::FuncRep funcRep;
	void chooseFunction(size_t FunChoice);
	

public:
	CEvaluatingFunction(double=-1.0f, double=1.0f,  size_t = 0, size_t = 100);
	~CEvaluatingFunction(void);	
	double evaluateCDNAStatementSemantics( BoundedFunctionPoints*, vector<double>);
	void draw(size_t = DRAW_GRID);	
};
